import { connect } from 'react-redux'
import { actions } from 'react-native-navigation-redux-helpers'

import Person from '../components/person'

const { popRoute } = actions

const mapStateToProps = (state) => ({
  navigation: state.cardNavigation
})

const bindAction = (dispatch) => ({
  onBack: (navigation) => {
    dispatch(popRoute(navigation.key))
  }
})

export default connect(mapStateToProps, bindAction)(Person)
